//
//  Account.h
//  susencloud
//
//  Created by tanchao on 15/11/10.
//  Copyright © 2015年 chaoren. All rights reserved.
//

#import <Foundation/Foundation.h>
/**
 {
 "access_token" = a624f7027cc3d283cc47e4d2ab37d154;
 adminprivatekey = "5e/p4nUjAUh3pQ4qnjLM7ZqpegJlhYczJrvWc91QcqU=";
 departments =     (
 "\U7814\U53d1\U90e8"
 );
 email = "ecloudtest20@163.com";
 "expires_in" = 2550763;
 name = "\U5c0f\U7070";
 privatekey = "RWqjwPVOwsqx67OXd7ngPCb6BZtzf8sDxIp4a5AgxqI=";
 recycleBinId = CN28QM3P;
 "refresh_token" = 43db8f3443dc165bc1dc50ad163bec0a;
 "resource_server" = "https://e.surdoc.net";
 roleName = user;
 rootFolderId = CN28QM41;
 shareFolderRootId = CN25ZGF8;
 spaces = 10;
 state = 1;
 }
 */
/// 账户
@interface Account : NSObject
/// 访问token
@property (nonatomic, copy) NSString *access_token;
/// 管理员私钥
@property (nonatomic, copy) NSString *adminprivatekey;
/// 用户email
@property (nonatomic, copy) NSString *email;
//    access_token的生命周期，单位是秒数。
//        expires_date = NSDate(timeIntervalSinceNow: expires_in)
@property (nonatomic, assign) NSTimeInterval expires_in;
/// 标准日期
@property (nonatomic, strong) NSDate *expires_date;
/// 姓名
@property (nonatomic, copy) NSString *name;
/// 用户私钥
@property (nonatomic, copy) NSString *privatekey;
/// 回收站id
@property (nonatomic, copy) NSString *recycleBinId;
/// 刷新token
@property (nonatomic, copy) NSString *refresh_token;
///  资源服务器
@property (nonatomic, copy) NSString *resource_server;
///  用户角色
@property (nonatomic, copy) NSString *roleName;
/// 根目录id
@property (nonatomic, copy) NSString *rootFolderId;
/// 共享文件夹根目录id
@property (nonatomic, copy) NSString *shareFolderRootId;
/// 用户空间大小
@property (nonatomic, copy) NSString *spaces;
/// 账号状态
@property (nonatomic, copy) NSString *state;
+(instancetype)accountWithDict:(NSDictionary *)dict;
+(instancetype)sharedAccount;
+ (void)loginAccountWithDict:(NSDictionary *)dict;
@end
